//
//  ZFCrypto.h
//  ZFCommonCore
//
//  Created by 赵梁 on 2016/10/2.
//  Copyright © 2016年 zhaoliang. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 加密算法
 */
typedef NS_ENUM(NSUInteger, ZFCryptAlgorithm) {
    ZFCryptAlgorithmAES128 = 0,
    ZFCryptAlgorithmAES256,
    ZFCryptAlgorithmDES,
    ZFCryptAlgorithm3DES,
};


/**
 加解密操作

 - ZFCryptEncrypt: 解密操作
 - ZFCryptDecrypt: 解密操作
 */
typedef NS_ENUM(NSUInteger, ZFCryptOperation) {
    ZFCryptEncrypt = 0,
    ZFCryptDecrypt
};

@interface ZFCryptor : NSObject

+ (NSString*)cryptStrByBase64:(NSString*)plZFnText tripleKey:(NSString *)desKey algorithm:(ZFCryptAlgorithm)algorithm operation:(ZFCryptOperation)operation;

+ (NSString*)cryptStrByHex:(NSString*)plZFnText tripleKey:(NSString *)desKey algorithm:(ZFCryptAlgorithm)algorithm operation:(ZFCryptOperation)operation;

#pragma mark - core helper

+ (NSString*)cryptStr:(NSString*)plZFnText tripleKey:(NSString *)desKey algorithm:(ZFCryptAlgorithm)algorithm operation:(ZFCryptOperation)operation;

+ (NSData*)cryptData:(NSData*)plZFnData tripleKey:(NSString *)desKey algorithm:(ZFCryptAlgorithm)algorithm operation:(ZFCryptOperation)operation;

@end
